<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Role_Add_Page</title>
<style type="text/css">
a{
 	font-size:14px;
 	color:blue;
 	text-decoration:underline;
}
a:hover{
	font-size:14px;
	color:#000;
	text-decoration:underline;
}
a{
	cursor:pointer;
}
ul,li{
	list-style-type:none;
}
.box{
	width:100%;
	height:250px;
}
.box ul{
	margin:0px auto;
	width: 100%;
	height: auto;
	float: left;
}
.box_div{
	float:left;
}
</style>
<script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery-1.11.0.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/js/myJs/role_edit.js"></script>
</head>
<body>
<div>
	<form action="" method="post">
		<div>
			<label>名称：</label>
			<input type="text" id="tblRole.roleName" name="tblRole.roleName" value="${requestScope.tblRole.roleName}"/>
		</div>
		<div>
			<label>简介：</label>
			<input type="text" id="tblRole.roleAbstract" name="tblRole.roleAbstract" value="${requestScope.tblRole.roleAbstract}"/>
		</div>
		<div>
			<span id="role_edit_prompt"></span>
		</div>
		<div>
			<input type="button" value="确定" onclick="role_edit('${requestScope.tblRole.roleId}');"/>
		</div>
	</form>
</div>
<c:if test="${requestScope.role_rights==0 }">
	<div id="rights_box_null" style="display: ;">
		<p>该角色未拥有权限，是否<a onclick="showRights_box();">添加</a>。</p>
	</div>
	<div id="rights_box_full" class="box" style="display:none;">
		<c:forEach var="parent_r" items="${sessionScope.role_rights_map}" varStatus="index">
			<div class="box_div">
				<div style="margin-left:20px;" >
					<input type="checkbox" id="${parent_r.key.rightsCode}" name="checkbox_all" onclick="choose_all('${parent_r.key.rightsCode}');"/>
					<span>${parent_r.key.rightsTip}</span>
				</div>
				<ul>
					<c:forEach var="child_r" items="${parent_r.value }" varStatus="child_index">
						<li>
							<input type="checkbox" id="${child_r.key.rightsCode}" name="${child_r.key.rightsParentCode }" onclick="pad_all('${child_r.key.rightsParentCode}');" />
							<span>${child_r.key.rightsTip}</span>
						</li>
					</c:forEach>
				</ul>
			</div>
		</c:forEach>
	</div>
	<div id="rights_box_btn" style="display:none;">
		<input type="button" value="添加权限" onclick="role_add_rights('checkbox_all','${requestScope.tblRole.roleId}');"/>
		<span id="rights_prompt"></span>
	</div>
</c:if>
<%-- <c:if test="${requestScope.role_rights==1}">
</c:if> --%>
</body>
</html>